package com.flute.framework;

import com.flute.framework.exception.ConfigurationParseException;
import com.flute.framework.index.TimerIndexer;

public class IndexMain {
	public static void main(String[] args) {
		if (args.length > 0) {
			for (int i = 0; i < args.length; i++) {
				try {
					Flute instance = Flute.getInstance();
					TimerIndexer indexer = instance.getIndexer(args[i]);
					if (indexer != null) {
						indexer.start();
					} else {
						System.err.println("找不到索引,索引名字是" + args[i]);
					}
				} catch (ConfigurationParseException e) {
					throw new RuntimeException("解析索引" + args[i] + "出错:" + e);
				}
			}
		}
	}
}
